package br.edu.ufcg.ga.parser.args.group;

import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.Option;
import org.apache.commons.cli.OptionBuilder;
import org.apache.commons.cli.ParseException;
import org.jgap.Configuration;
import org.jgap.GeneticOperator;
import org.jgap.InvalidConfigurationException;
import org.jgap.impl.GreedyCrossover;

public class GOgreedyCrossoverOperatorGroupBuilder extends AbstractMyGroupBuilder {

	private Option GOgreedyCrossoverOperator;

	@SuppressWarnings("static-access")
	@Override
	protected void init() {
		this.GOgreedyCrossoverOperator = OptionBuilder
				.withDescription(
						"\"Crossover 1\" do artigo \"Comparative Study of Some Solution Methods for Traveling Salesman Problem Using Genetic Algorithms\"")
				.withLongOpt("GOgreedyCrossoverOperator").create("GO_GCO");

	}

	@Override
	public void configSafely(Configuration config, CommandLine commandLine) throws InvalidConfigurationException,
			ParseException {
		GeneticOperator go = new GreedyCrossover(config);
		config.addGeneticOperator(go);
	}

	@Override
	protected Option getMainOption() {
		return this.GOgreedyCrossoverOperator;
	}

	@Override
	protected Option[] getOtherOptions() {
		return new Option[] {};
	}

}
